//
//  ATUtil.h
//  ABCTime
//
//  Created by admin on 25/11/2017.
//  Copyright © 2017 100TAL. All rights reserved.
//

#import <UIKit/UIKit.h>

static NSString * const ATiPhoneSize_4S     = @"4S";
static NSString * const ATiPhoneSize_5      = @"5";
static NSString * const ATiPhoneSize_6      = @"6";
static NSString * const ATiPhoneSize_6P     = @"6P";
static NSString * const ATiPhoneSize_x      = @"X";

#define $(format, ...) [NSString stringWithFormat:format, ##__VA_ARGS__]
#define WeakSelf __weak typeof(self) weakSelf = self;

@interface ATUtil : NSObject

CGFloat ATSCREEN_SCALE_RATIO (void);

CGFloat ATSCREEN_HEIGHT (void);

CGFloat ATSCREEN_WIDTH (void);

+ (BOOL)isiPhoneSize_3_5;

+ (BOOL)isiPhoneSize_4_0;

+ (BOOL)isiPhoneSize_4_7;

+ (BOOL)isiPhoneSize_5_5;

+ (BOOL)isiPhoneX;

+ (BOOL)isiPad;

+ (BOOL)isiPhoneXR;

// iphone x 留海是否在左边
+ (BOOL)isBlackHairLeft;

+ (NSString *)getiPhoneSize;

+ (NSString *)directoryPathInLibrary:(NSString *)directoryName;

+ (NSString *)hexStringFromBytes:(const unsigned char *)bytes length:(NSInteger)length;

+ (NSString *) at_resourcePathWithClass:(Class) bundleClass
                             bundleName:(NSString *) bundleName
                                subPath:(NSString *)subPath
                               fileName:(NSString *)fileName;

+ (BOOL)fileIsExistOfPath:(NSString *)filePath;

+ (BOOL)saveFile:(NSString *)filePath withData:(NSData *)data;

+ (NSString *)getCachePath;

@end

@interface UIView (ATUtil)

@end
// ====================================================================================================== //
// >>>>>>> Category >> NSString + ATUtil
@interface NSString (ATUtil)
- (BOOL)at_isPhoneNumber;
- (BOOL)at_isNumber;
- (BOOL)at_isConformRegular:(NSString *)regular;
@end
// ====================================================================================================== //
@interface NSArray (ATUtil)
- (instancetype) at_safeObjectAtIndex:(NSInteger) index;
@end

